package com.rppowell.pixie.swing.spriteset;

import javax.swing.AbstractListModel;

import com.rppowell.pixie.models.Sprite;
import com.rppowell.pixie.models.SpriteSet;

public class SpriteSetListModel extends AbstractListModel<Sprite> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private SpriteSet spriteset;

	public SpriteSetListModel(SpriteSet s) {
		spriteset = s;
	}
	
	@Override
	public Sprite getElementAt(int index) {
		if (spriteset != null) {
			return spriteset.get(index);
		}
		return null;
	}

	@Override
	public int getSize() {
		if (spriteset != null) {
			return spriteset.size();
		}
		return 0;
	}
	
	public SpriteSet getSpriteSet() {
		return spriteset;
	}
}
